export default {
    namespaced:true,
    state: () => ({ 
        count:1,
        stname:'Asuka'
     }),
    mutations: { 
        add(state,num){
            console.log('你先加',num);
            if(num){
              state.count+=10;
            }else{
              state.count++
            }
            state.count++
          },
          sub(state){
            state.count--
          },
          sub2(state,num){
            state.count-=num;
          },
          tianqi(state){
            setTimeout(() =>{
              console.log('假的异步请求');
              state.count=Math.random();
            },2000)
          }
     },
    actions: { 
        testajax(context){
            context.commit('tianqi')
           }
     },
    getters: { 

     }
  }